﻿using System;
using System.IO;

namespace SEXY
{
	// Token: 0x020002A2 RID: 674
	[Serializable]
	public class CharFileInfoPreview : BlockControlBase
	{
		// Token: 0x0600110B RID: 4363 RVA: 0x0006CFAC File Offset: 0x0006B1AC
		public CharFileInfoPreview() : base("プレビュー情報", 4)
		{
		}

		// Token: 0x0600110C RID: 4364 RVA: 0x0006CFD0 File Offset: 0x0006B1D0
		public override bool LoadBytes(byte[] data, int previewVer)
		{
			bool result;
			using (MemoryStream memoryStream = new MemoryStream(data))
			{
				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
				{
					if (4 <= previewVer)
					{
						this.productNo = binaryReader.ReadInt32();
					}
					this.sex = binaryReader.ReadInt32();
					if (2 <= previewVer)
					{
						this.personality = binaryReader.ReadInt32();
						int num = binaryReader.ReadInt32();
						this.name = binaryReader.ReadString();
						this.height = binaryReader.ReadInt32();
						this.bustSize = binaryReader.ReadInt32();
						this.hairType = binaryReader.ReadInt32();
					}
					if (4 <= previewVer)
					{
						this.state = binaryReader.ReadInt32();
						this.resistH = binaryReader.ReadInt32();
						this.resistPain = binaryReader.ReadInt32();
						this.resistAnal = binaryReader.ReadInt32();
					}
					if (3 <= previewVer)
					{
						this.isConcierge = binaryReader.ReadInt32();
					}
					result = true;
				}
			}
			return result;
		}

		// Token: 0x0600110D RID: 4365 RVA: 0x0006D0DC File Offset: 0x0006B2DC
		public void Update(CharFile chaFile)
		{
			this.sex = (int)chaFile.customInfo.sex;
			this.name = chaFile.customInfo.name;
			this.isConcierge = ((!chaFile.customInfo.isConcierge) ? 0 : 1);
			if (this.sex == 0)
			{
				this.personality = 255;
				this.height = 255;
				this.bustSize = 255;
				this.hairType = 255;
				this.state = 255;
				this.resistH = 255;
				this.resistPain = 255;
				this.resistAnal = 255;
			}
			else
			{
				this.personality = chaFile.customInfo.personality;
				float num = chaFile.customInfo.shapeValueBody[0];
				if (num < 0.33f)
				{
					this.height = 0;
				}
				else if (num > 0.66f)
				{
					this.height = 2;
				}
				else
				{
					this.height = 1;
				}
				float num2 = chaFile.customInfo.shapeValueBody[1];
				if (num2 < 0.33f)
				{
					this.bustSize = 0;
				}
				else if (num2 > 0.66f)
				{
					this.bustSize = 2;
				}
				else
				{
					this.bustSize = 1;
				}
				this.hairType = chaFile.customInfo.hairType;
			}
		}

		// Token: 0x04001281 RID: 4737
		public int previewLoadVersion;

		// Token: 0x04001282 RID: 4738
		public int productNo = 11;

		// Token: 0x04001283 RID: 4739
		public int sex;

		// Token: 0x04001284 RID: 4740
		public int personality;

		// Token: 0x04001285 RID: 4741
		public string name = string.Empty;

		// Token: 0x04001286 RID: 4742
		public int height;

		// Token: 0x04001287 RID: 4743
		public int bustSize;

		// Token: 0x04001288 RID: 4744
		public int hairType;

		// Token: 0x04001289 RID: 4745
		public int state;

		// Token: 0x0400128A RID: 4746
		public int resistH;

		// Token: 0x0400128B RID: 4747
		public int resistPain;

		// Token: 0x0400128C RID: 4748
		public int resistAnal;

		// Token: 0x0400128D RID: 4749
		public int isConcierge;
	}
}
